﻿using System.Windows;
using System.Windows.Data;

namespace WindowsPhoneMvp.Util
{
    internal class BindingEvaluator : FrameworkElement
    {
        public object Value
        {
            get
            {
                Value = DependencyProperty.UnsetValue;
                SetBinding(ValueProperty, binding);
                return GetValue(ValueProperty);
            }
            private set { SetValue(ValueProperty, value); }
        }
        static readonly DependencyProperty ValueProperty =
            DependencyProperty.Register("Value", typeof(object), typeof(BindingEvaluator), null);

        readonly Binding binding;
        public BindingEvaluator(Binding binding)
        {
            this.binding = binding;
        }
    }
}
